package builder.example;

/**
 * @Author：LJ
 * @Description：
 * @Date: 2017/11/27
 * @Modified By:
 */
public class CarBuilderFactory {

    public <T extends CarBuilder> T createBuilder(Class<T> tClass) {
        CarBuilder carBuilder = null;
        try {
            carBuilder = (CarBuilder) Class.forName(tClass.getName()).newInstance();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return (T) carBuilder;
    }
}
